#include <iostream>
#include <unordered_set>

using std::cout;
using std::endl;
using std::unordered_set;

template <typename Container>
void display(const Container &con)
{
    for(auto &elem : con)
    {
        cout << elem << "   ";
    }
    cout << endl;
}

void test()
{
    //unordered_set的特征
    //1、存放的是key类型，key值是唯一的，不能重复
    //2、元素是没有顺序的
    //3、底层使用的是哈希
    unordered_set<int> number = {1, 3, 9, 8, 7, 4, 3, 1, 5, 3};
    display(number);

    cout << endl << endl;
    auto it = number.begin();
    cout << "*it = " << *it <<endl;
    /* *it = 10;//error */

    /* cout << number[1] << endl;//error */
}

int main(int argc, char *argv[])
{
    test();
    return 0;
}

